﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="Stylesheet" type="text/css" href="styles/style.css" />
    <script type="text/javascript" src="scripts/jquery-1.2.6.js"></script>
    <script type="text/javascript" src="scripts/MiniSudoku.js"></script>
    <script type="text/javascript" language="javascript">
        var miniSudoku;
        $(document).ready(function()
        {
            miniSudoku = new Puzzle('Square', 'SelectedSquare', $('#Main').get(0));
            miniSudoku.getBox(0, 0).setElement($('#square11').get(0));
            miniSudoku.getBox(0, 1).setElement($('#square12').get(0));
            miniSudoku.getBox(1, 0).setElement($('#square21').get(0));
            miniSudoku.getBox(1, 1).setElement($('#square22').get(0));

            $('#Main > div').click(function()
            {
                $(this).get(0).box.toggleSelection();
            });
            
            $(this).keydown(function(event)
            {
                miniSudoku.onKeyDown(event.keyCode);
            });

            miniSudoku.loadNewPuzzle();
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="Main" class="Main">
            <div id="square11" class="Square"></div>
            <div id="square12" class="Square"></div>
            <div id="square21" class="Square"></div>
            <div id="square22" class="Square"></div>
        </div>
    </div>
    
    <div style="clear: both;">
        <br />
        <input type="button" value="Validate" onclick="miniSudoku.validate();" />&nbsp;
        <input type="button" value="New Puzzle" onclick="miniSudoku.loadNewPuzzle();" />
    </div>
    </form>
</body>
</html>
